package com.itcam.config;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * Author:Cammy.Wu
 * Date:2024-04-30
 * Description:mvc组件的配置类
 */

@Configuration
@ComponentScan(basePackages = {"com.itcam.controller", "com.itcam.exceptionhandler"})
@EnableWebMvc
public class MvcConfig implements WebMvcConfigurer {

    // 开启静态资源查找
    // dispatchServlet -> handlerMapping找到没有对应的handler -> 【没有 -> 找有没有静态资源】
    @Override
    public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
        configurer.enable();
    }
}
